#include "my_loger_writer.hpp"
#include "pjsip_manager.hpp"
#include "string.h"
#include "napi/native_api.h"
#include "uv.h"
#include "hilog/log.h"
using namespace pj;

void MyLogWriter::write(const LogEntry &entry)
{
    auto context = PJSUAManager::getInstace()->callbackData;
    Message *message = new Message();
    message->method = "log";
    message->value1 = entry.msg;
    napi_call_threadsafe_function(context->tsfn, message, napi_tsfn_nonblocking);
}